package by.ostrovsky.webhousingsystem.hibernate.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import by.ostrovsky.webhousingsystem.hibernate.entity.common.Common;

@Entity
@Table(name = "workplan")
public class WorkPlan extends Common<Long>{
	@Id
	@Column(name = "WORKPLAN_ID")
	private Long id;
	@Column(name = "WORKPLAN_ISDONE")
	private Boolean done;
	@Column(name = "WORKPLAN_DEADLINE")
	@Temporal(value = TemporalType.DATE)
	private Date deadline;
	@ManyToOne
	@JoinColumn(name = "REQUESTEDWORK_ID")
	private UserRequest requestedWork;
	@ManyToOne
	@JoinColumn(name = "TASKGROUP_ID")
	private TaskGroup taskGroup;
	
	public WorkPlan(){}
	
	@Override
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Boolean getDone() {
		return done;
	}
	public void setDone(Boolean done) {
		this.done = done;
	}
	public Date getDeadline() {
		return deadline;
	}
	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public UserRequest getRequestedWork() {
		return requestedWork;
	}

	public void setRequestedWork(UserRequest requestedWork) {
		this.requestedWork = requestedWork;
	}

	public TaskGroup getTaskGroup() {
		return taskGroup;
	}

	public void setTaskGroup(TaskGroup taskGroup) {
		this.taskGroup = taskGroup;
	}
	
	
}
